﻿using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Data.Linq.SqlClient;
namespace TraCuuTinRaoVat
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           
                if (this.Request.QueryString["Search"] != null)
                {

                    timKiem(this.Request.QueryString["Search"]);


                }
            

        }




        private void timKiem(string searchedString)
        {
            LinQ_RaoVatDataContext linQ = new LinQ_RaoVatDataContext();
            var query = from Tin_Rao_Vat in linQ.TIN_RAO_VATs
                        where SqlMethods.Like(Tin_Rao_Vat.TenTinRaoVat, "%" + searchedString + "%") || SqlMethods.Like(Tin_Rao_Vat.NoiDungTinRaoVat, "%" + searchedString + "%")
                        select Tin_Rao_Vat;

            DanhSachTinRaoVatTheoList1.ListTinRaoVat = query.ToList();
           
        }

    }
}
